import http from "@/utils/http";

/**
 * 获取数据列表
 *
 * @param {Object} params 请求参数
 * @returns {*}
 */
export function getLogOperationList(params = {}) {
  return http.post("/system/log/operation/list", params);
}

/**
 * 添加数据
 *
 * @param {Object} params 请求参数
 * @returns {*}
 */
export function addLogOperation(params) {
  return http.post("/system/log/operation/insert", params);
}

/**
 * 查看详情
 *
 * @param {Object} params 请求参数
 * @returns {*}
 */
export function getLogOperation(params) {
  return http.get(`/system/log/operation/detail/${params}`);
}

/**
 * 更新数据
 *
 * @param {Object} params 请求参数
 * @returns {*}
 */
export function updateLogOperation(params) {
  return http.post("/system/log/operation/update", params);
}

/**
 * 删除数据
 *
 * @param {Number} id id
 * @returns Promise
 */
export function deleteLogOperation(id) {
  return http.post("/system/log/operation/delete", id, {
    headers: {
      "content-type": "application/json",
    },
  });
}

/**
 * 批量删除数据
 *
 * @param {Array} id ids
 * @returns Promise
 */
export function deleteBatchLogOperation(ids) {
  return http.post("/system/log/operation/deleteBatch", ids);
}

export function getExportParams() {
  return http.get("/system/log/operation/export/params");
}

export function exportOperationLog(params = {}) {
  return http.post("/system/log/operation/export", params, {
    responseType: "blob",
  });
}
